#pragma once

#include <string>
#include <cstdlib>
#include "qSocket.hpp"
#include "ITransport.h"

using namespace std;

namespace OmronPlc
{
	class tcpTransport : ITransport
	{
	private:
		qSocketClient _socket;
		uint16_t _port;
		cstr_t _ip;

	public:
		tcpTransport();
		virtual ~tcpTransport();
		virtual void SetRemote(cstr_t ip, uint16_t port);
		virtual bool Connect();
		virtual bool IsConnectd();
		virtual void Close();
		virtual int Send(const uint8_t command[], int cmdLen);
		virtual int Receive(uint8_t response[], int respLen);
	};
}
